package com.hanfneg.client.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
/**
 * 数据库助手类
 * @author hanfeng
 * @data 2012-8-31 下午2:29:44
 */
public class DBHelper extends SQLiteOpenHelper {
	/*数据库名字*/
	public static final String DBNAME = "hf_music";
	/*数据库表 本地歌曲*/
	public static final String TAB_LOCALMUSIC = "local_music";
	/*数据库版本*/
	private static final int VERSION = 1;
	
	public DBHelper(Context context){
		super(context, DBNAME, null, VERSION);
	}
	
	public DBHelper(Context context,int version){
		super(context, DBNAME, null, version);
	}
	

	public DBHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}
	/*创建数据库*/
	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("create table if not exists "+TAB_LOCALMUSIC+"("
				+"_id integer primary key,"
				+"musicname text not null,"
				+"singer text,"
				+"_data text not null"
				+")");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub

	}

}
